package main

import "fmt"

type struct_human struct {
	Sex int
}

type struct_teacher struct {
	struct_human//嵌入结构
	Name string
	Age int
}

type struct_student struct {
	struct_human
	Name string
	Age int
}

func main() {
	a := struct_teacher{
		Name:"hello",
		Age:18,
		struct_human : struct_human{Sex:0},
	}
	b := struct_student{
		Name:"world",
		Age:20,
		struct_human : struct_human{Sex:1},
	}
	fmt.Println(a)
	fmt.Println(b)
	a.struct_human.Sex = 100
	b.Sex = 200
	fmt.Println(a)
	fmt.Println(b)
}